home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / gfx / show / gs_src_gs.lha / gs5.03 / idparam.h < prev    next >
C/C++ Source or Header  |  1995-11-15  |  3KB  |  76 lines

  1. /* Copyright (C) 1992, 1993, 1994 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* idparam.h */
  20. /* Interface to idparam.c */
  21.  
  22. #ifndef gs_matrix_DEFINED
  23. #  define gs_matrix_DEFINED
  24. typedef struct gs_matrix_s gs_matrix;
  25. #endif
  26.  
  27. #ifndef gs_uid_DEFINED
  28. #  define gs_uid_DEFINED
  29. typedef struct gs_uid_s gs_uid;
  30. #endif
  31.  
  32. /*
  33.  * Unless otherwise noted, all the following routines return 0 for
  34.  * a valid parameter, 1 for a defaulted parameter, or <0 on error.
  35.  *
  36.  * Note that all the dictionary parameter routines take a C string,
  37.  * not a t_name ref *.  Even though this is slower, it means that
  38.  * the GC doesn't have to worry about finding statically declared
  39.  * name refs, and we have that many fewer static variables.
  40.  *
  41.  * All these routines allow pdict == NULL, which they treat the same as
  42.  * pdict referring to an empty dictionary.  Routines with "null" in their
  43.  * name return 2 if the parameter is null, without setting *pvalue.
  44.  */
  45. int dict_bool_param(P4(const ref *pdict, const char _ds *kstr,
  46.                bool defaultval, bool *pvalue));
  47. int dict_int_param(P6(const ref *pdict, const char _ds *kstr,
  48.               int minval, int maxval, int defaultval, int *pvalue));
  49. int dict_int_null_param(P6(const ref *pdict, const char _ds *kstr,
  50.                int minval, int maxval, int defaultval,
  51.                int *pvalue));
  52. int dict_uint_param(P6(const ref *pdict, const char _ds *kstr,
  53.                uint minval, uint maxval, uint defaultval,
  54.                uint *pvalue));
  55. int dict_float_param(P4(const ref *pdict, const char _ds *kstr,
  56.             floatp defaultval, float *pvalue));
  57. int dict_int_array_param(P4(const ref *pdict, const char _ds *kstr,
  58.                 uint maxlen, int *ivec));
  59. int dict_float_array_param(P5(const ref *pdict, const char _ds *kstr,
  60.                   uint maxlen, float *fvec,
  61.                   const float *defaultvec));
  62. /*
  63.  * For dict_proc_param,
  64.  *    defaultval = false means substitute t__invalid;
  65.  *    defaultval = true means substitute an empty procedure.
  66.  * In either case, return 1.
  67.  */
  68. int dict_proc_param(P4(const ref *pdict, const char _ds *kstr, ref *pproc,
  69.                bool defaultval));
  70. int dict_matrix_param(P3(const ref *pdict, const char _ds *kstr,
  71.              gs_matrix *pmat));
  72. int dict_uid_param(P4(const ref *pdict, gs_uid *puid, int defaultval,
  73.               gs_memory_t *mem));
  74. /* Check that a UID in a dictionary is equal to an existing, valid UID. */
  75. bool dict_check_uid_param(P2(const ref *pdict, const gs_uid *puid));
  76.